home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Essential Home & Business Collection
/
The Essential Home & Business Collection.iso
/
27
/
3
/
5
/
HP22D5.ZIP
/
EXTERN
/
HORLINE.C
< prev
next >
Wrap
Text File
|
1991-04-16
|
1KB
|
68 lines
#include "extern.h" /* Extensions need these! */
/*
** HORLINE, call with the following syntax:
**
** horline x1,x2,y,ch,attr [,<isPage>]
**
** x1 column to start the line 1 <= x1 <= 80
** x2 column to end the line x1 <= x2 <= 80
** y row for the line 1 <= y <= screenHeight()
** ch character to be drawn 0 <= ch <= 255
** attr attribute with which to draw that character 0 <= attr <= 255
** <isPage> optional parameter - TRUE if the line is to
** be drawn on the page, FALSE for the background.
** The default (if omitted) is TRUE.
**
** Warning: No error checking is done to see if x1 and x2 are valid.
*/
horLine(int NumArgs,
HANDLE hx1,
HANDLE hx2,
HANDLE hy,
HANDLE hch,
HANDLE hattr,
HANDLE hIsPage)
{
WORD w;
int x1,x2,y;
int sz,i;
WORD *s;
BOOLEAN ispage;
BYTE buf[160]; /* this is 2 * maximumScreenWidth (which is 80) */
if (NumArgs < 5 || NumArgs > 6) return(STOP);
x1 = htoi(hx1);
x2 = htoi(hx2);
y = htoi(hy);
w = (htoi(hattr) << 8) | *deref(hch);
ispage = (NumArgs == 6) ? htob(hIsPage) : TRUE;
sz = x2 - x1 + 1;
s = (WORD *)buf;
for (i=0;i<sz;i++) {
*s++ = w; /* character, attribute pair */
}
SetScreen(ispage,x1,y,x2,y,buf);
return(STOP);
}
POOL pascal Pool[] = {
{ "horLine",
horLine,
0,
HANDLER},
{ NULL,
NULL,
0,
0} };